package com.jodie.store.mapper;

import com.jodie.store.entity.User;
import org.apache.ibatis.annotations.Param;

import java.util.Date;

/**
 * 用户模块持久层接口
 * @author Jodie
 * @date 2023/2/2-20:53
 */
public interface UserMapper {

    Integer insert(User user);

    User findByUsername(String username);

    Integer updatePasswordByUid(Integer uid,
                                String password,
                                String modifiedUser,
                                Date modifiedTime);

    User findByUid(Integer uid);

    Integer updateInfoByUid(User user);

    // @Param("SQL映射文件中#{}占位符的变量名")：和映射的接口方法参数名不一致时，强行注入到占位符变量上
    Integer updateAvatarByUid(@Param("uid") Integer uid,
                              @Param("avatar") String avatar,
                              @Param("modifiedUser") String modifiedUser,
                              @Param("modifiedTime") Date modifiedTime);
}
